import { IRouteComponentProps, Redirect } from 'umi';

export default function Layout({
  children,
  location,
  route,
  history,
  match,
}: IRouteComponentProps) {
  const { pathname } = location;
  if (pathname === '/') {
    return <Redirect from="/" to="/admin"></Redirect>;
  } else {
    return children;
  }
}
